<!--
 * createor: zc
 * email: zc8023zs@163.com
 * create_time: 2020/3/14 13:46:24
 *-->
<template>
  <el-container>
    <el-header>
      品牌制造商详情
    </el-header>
    <el-main>
      <el-form label-width="200px" :inline="true" style="padding:5% 5% 0 5%">
        <el-form-item label="主键：">
          <span>{{formData.id}}</span>
        </el-form-item>
        <el-form-item label="品牌名称：">
          <span>{{formData.name}}</span>
        </el-form-item>
        <el-form-item label="列表图片：">
          <span>{{formData.list_pic_url}}</span>
        </el-form-item>
        <el-form-item label="描述：">
          <span>{{formData.simple_desc}}</span>
        </el-form-item>
        <el-form-item label="图片：">
          <span>{{formData.pic_url}}</span>
        </el-form-item>
        <el-form-item label="排序：">
          <span>{{formData.sort_order}}</span>
        </el-form-item>
        <el-form-item label="显示：">
          <span>{{formData.is_show}}</span>
        </el-form-item>
        <el-form-item label="展示价格：">
          <span>{{formData.floor_price}}</span>
        </el-form-item>
        <el-form-item label="app显示图片：">
          <span>{{formData.app_list_pic_url}}</span>
        </el-form-item>
        <el-form-item label="新品牌：">
          <span>{{formData.is_new}}</span>
        </el-form-item>
        <el-form-item label="新品牌图片：">
          <span>{{formData.new_pic_url}}</span>
        </el-form-item>
        <el-form-item label="新品牌排序：">
          <span>{{formData.new_sort_order}}</span>
        </el-form-item>
      </el-form>
    </el-main>
  </el-container>
</template>
<style scoped>
body .app-container .el-container,
body .app-container .el-header,
body .app-container .el-main,
body .el-container,
body .el-header,
body .el-main {
  padding: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
</style>
<script>
import { Loading } from "element-ui";
import {
  brandInfo
} from '@/api/project/simpleshopsetting/project_simpleshopsetting_brand'
export default {
  name: "a_simpleshopsettinga_brand_info",
  data() {
    return {
      infoLoading: false,
      formData:{
        id: 0, 
        name: '', 
        list_pic_url: '', 
        simple_desc: '', 
        pic_url: '', 
        sort_order: 0, 
        is_show: 0, 
        floor_price: 0.0, 
        app_list_pic_url: '', 
        is_new: 0, 
        new_pic_url: '', 
        new_sort_order: 0, 
      }
    };
  },
  activated() {
    var result = location.search.match(new RegExp("[\?\&]id=([^\&]+)", "i"));
    if(result != null || result.length > 0){
      this.onInfo(result[1]);
    }
  },
  methods: {
    onInfo(id){
      this.infoLoading=true;
      brandInfo({id:id}).then(r=>{
        this.formData.id = r.dataSingle.id, 
        this.formData.name = r.dataSingle.name, 
        this.formData.list_pic_url = r.dataSingle.list_pic_url, 
        this.formData.simple_desc = r.dataSingle.simple_desc, 
        this.formData.pic_url = r.dataSingle.pic_url, 
        this.formData.sort_order = r.dataSingle.sort_order, 
        this.formData.is_show = r.dataSingle.is_show, 
        this.formData.floor_price = r.dataSingle.floor_price, 
        this.formData.app_list_pic_url = r.dataSingle.app_list_pic_url, 
        this.formData.is_new = r.dataSingle.is_new, 
        this.formData.new_pic_url = r.dataSingle.new_pic_url, 
        this.formData.new_sort_order = r.dataSingle.new_sort_order, 
        this.infoLoading=false;
      }).catch(()=>{
        this.infoLoading=false;
      });
    }
  }
}
</script>
